package com.qf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.io.IOException;

/**
 * @ClassName UpdateController
 * @Description TODO
 * @Author 86181
 * @Date 2022/9/6 10:11
 * @Version 1.0
 **/
@Controller
public class UpdateController {
    @PostMapping("/upload")
    public String fileUpload(MultipartFile file) throws IOException {
        //获取文件名
        String filename=file.getOriginalFilename();
        System.out.println(filename);
        file.transferTo(new File("D:\\bb",filename));
        return "success";
    }

}
